<template>
  <div class="mobile-product-2">
    <img v-slide-plus :src="info.image3" />
    <Title
      v-slide-up
      title="PRODUCT CORE FUNCTIONS"
      color="linear-gradient(90deg, #4580dd 0%, rgba(0, 0, 0, 0) 100%)"
      size="16"
      bold="700"
      sub-title="产品核心功能"
      sub-color="#0e0b31"
      sub-size="24"
      sub-bold="700"
      gap="10"
      class="mb30"
    />
    <el-collapse v-slide-up v-model="collapseName" accordion>
      <el-collapse-item
        v-for="(item, k) in info.core"
        :key="k"
        :title="item.name"
        :name="k"
      >
        <div class="collapse-content">{{ item.introduce }}</div>
      </el-collapse-item>
    </el-collapse>
    <div class="f f-ac f-jc">
      <div v-slide-plus class="btn-box" @click="handleContact">立即咨询</div>
    </div>
  </div>
</template>
<script setup lang="ts">
const props = defineProps({
  info: {
    type: Object,
    default: () => {},
  },
});
const emit = defineEmits(["contact"]);

const collapseName = ref(0);

// 立即咨询
const handleContact = () => {
  emit("contact", `产品核心功能：${props.info.name}`);
};
</script>
<style lang="scss" scoped>
.mobile-product-2 {
  width: 100%;
  min-height: 31.25rem;
  background-color: #f6f6f6;
  padding: 1.25rem;
  box-sizing: border-box;
  img {
    width: 100%;
    object-fit: cover;
    border: 0.75rem solid #fff;
    border-radius: 0.75rem;
    margin: 1.25rem auto;
    box-sizing: border-box;
  }
  .collapse-content {
    padding: 0.75rem 1.625rem;
  }
  .btn-box {
    width: 10.25rem;
    height: 3.375rem;
    font-size: 0.875rem;
    font-weight: 700;
    margin-top: 1.25rem;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #4580dd;
    &:active {
      background-color: #3a6dc0;
    }
  }
}
:deep(.el-collapse) {
  border-radius: 0.75rem;
  overflow: hidden;
  .el-collapse-item__header {
    padding: 1.125rem 1.625rem;
    background: #fafafa;
  }
  .el-collapse-item {
    margin-bottom: 0.25rem;
    &:last-child {
      margin-bottom: 0;
    }
  }
  .is-active {
    background-color: #fff;
  }
}
</style>
